<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script>
        // var x;


        // console.log(x);
    </script>
    <style>
        #body{background-color:#fff;}
        #id{width:100%;height:100%;background-color: #fff}
    </style>

</head>
<body onkeydown=doKey(event) >
    <div id="bg">
    <!-- <input type="text" id="name" onchange=test1()>
    <script>
        function test1()
        {
            console.log(1);
        }
    </script> -->
    
    <script>
        var puts=new Array();

        var T;

        var Need = 0;
        
        var link = `<a href="http://www.baidu.com" target=_blank>神秘链接</a>`;

        function doKey(e)
        {
        
            if(e.which)
            {
                Need = 1;
                
                puts.push(e.which);
            }
            
            fin();
            doReset();
            
        }

        function fin()
        {
            if(puts.toString()=="38,38,40,40,37,39,37,39,66,65")
            {
                document.write(link);

                var bg = document.getElementById("bg");

                bg.style.backgroundColor ="#000";
            }
        }

        // function clearT()
        // {
        //     puts = [];
        //     console.log("reset");
        // }

        function doReset()
        {
            if(Need==1)
            {
                setTimeout(function clearT(){puts=[];},3000);

                Need=0;
            }
        }
        //setInterval(function clearT(){puts=[];console.log("reset")},3000);
    </script>
   <!--  <script>
        setInterval(function a(){alert('aaa')},3000);
    </script> -->
</div>
</body>
</html>